import request from '@/utils/request'

// 查询分类下拉树列表
export function listTreeCategory() {
  return request({
    url: '/product/category/list/tree',
    method: 'get'
  })
}

// 新增商品分类
export function addCategory(data) {
  return request({
    url: '/product/category/save',
    method: 'POST',
    data: data
  })
}


// 修改商品分类
export function updateCategory(data) {
  return request({
    url: '/product/category/update',
    method: 'POST',
    data: data
  })
}

// 批量修改商品分类
export function updateCategoryBatch(data) {
  return request({
    url: '/product/category/update/sort',
    method: 'POST',
    data: data
  })
}


// 查询商品分类
export function getCategoryById(id) {
  return request({
    url: '/product/category/info/'+id,
    method: 'GET'
  })
}


// 批量删除商品分类
export function delCategoryByIds(ids) {
  return request({
    url: '/product/category/delete',
    method: 'delete',
    data: ids
  })
}
